package cn.edu.buaa.nlsde.grid.Structure;

import java.util.ArrayList;
import java.util.List;

public class Host
{
	public int hostID;
	public String hostName;
	private String hostIP;
	private String reportedTime;
	private String tn;
	private String tmax;
	private String dmax;
	private String location;
	private String gmond_started;
	private List<Metric> metrics;
	
	public Host()
	{
		metrics=new ArrayList<Metric>();
	}
	
	public int getID()
	{
		return hostID;
	}
	public void setID(int hostID)
	{
		this.hostID=hostID;
	}

	public String getName()
	{
		return hostName;
	}
	public void setName(String hostName)
	{
		this.hostName=hostName;
	}

	public String getIP()
	{
		return hostIP;
	}
	public void setIP(String hostIP)
	{
		this.hostIP=hostIP;
	}

	public List<Metric> getMetrics()
	{
		return metrics;
	}
	public void setMetrics(List<Metric> metrics)
	{
		this.metrics=metrics;
	}

	public String getDMAX()
	{
		return dmax;
	}
	public void setDMAX(String dmax)
	{
		this.dmax=dmax;
	}

	public String getGmond_started()
	{
		return gmond_started;
	}
	public void setGmond_started(String gmond_started)
	{
		this.gmond_started=gmond_started;
	}

	public String getLocation()
	{
		return location;
	}
	public void setLocation(String location)
	{
		this.location=location;
	}

	public String getReportedTime()
	{
		return reportedTime;
	}
	public void setReportedTime(String reportedTime)
	{
		this.reportedTime=reportedTime;
	}

	public String getTMAX()
	{
		return tmax;
	}
	public void setTMAX(String tmax)
	{
		this.tmax=tmax;
	}

	public String getTN()
	{
		return tn;
	}
	public void setTN(String tn)
	{
		this.tn=tn;
	}
	
	public String getMetric(String metricName)
	{
		String value="-1";
		for(int i=0;i<metrics.size();i++)
		{
			Metric metric=(Metric)(Metric)metrics.get(i);
			if(metric.getName().equals(metricName))
			{
				value=metric.getVal();
				break;
			}
		}
		return value;
	}
}